home *** CD-ROM | disk | FTP | other *** search
- /*
- *
- * windows.c
- *
- * Window handling routines.
- *
- *
- * Author: Rob Johnston
- * Date: Monday, January 20, 1992
- *
- * Copyright © 1992 Apple Computer, Inc.
- *
- */
-
-
- #include "globals.h"
-
-
- /*
- * UpdateWindow is called when an update event is received for a docuemnt
- * window.
- */
-
- void UpdateWindow(Document *theDocument)
-
- { WindowPtr theWindow;
-
- theWindow = theDocument->theWindow;
-
- SetPort(theWindow);
- BeginUpdate(theWindow);
-
- EraseRect(&theWindow->portRect);
-
- DrawControls(theWindow);
- DrawGrowIcon(theWindow);
-
- TEUpdate(&theWindow->portRect, theDocument->theTE);
-
- EndUpdate(theWindow);
- }
-
-
- /*
- * GrowDocumentWindow is called when the user clicks in the growRgn of a
- * document window.
- */
-
- void GrowDocumentWindow(WindowPtr theWindow, Point thePoint)
-
- { long result;
- Rect sizeRect;
-
- SetPort(theWindow);
-
- sizeRect = screenBits.bounds;
- if (!(result = GrowWindow(theWindow, thePoint, &sizeRect)))
- return;
- SizeWindow(theWindow, LoWord(result), HiWord(result), false);
- PositionDocumentParts((Document *) ((WindowPeek) theWindow)->refCon);
- AdjustScrollBar((Document *) ((WindowPeek) theWindow)->refCon);
- InvalRect(&theWindow->portRect);
- }
-
-